<template>
<view>
<!--payment.wxml-->
<view v-if="order.take_time">
    <view class="booksucce_tips">
        预约成功
    </view>
    <view class="booksucce_info">
       {{order.goods_name}}
    </view>
    <view class="booksucce_info" style="font-size:12pt">
        请按时到店，凭券码确认订单消费
    </view>
    <view class="booksucce_time">
      <view>预约时间</view>
      <view>{{order.take_time}}</view>
    </view>
    <view class="view_bookinfo" @tap="beSpeakOrder">查看预约订单</view>
    
</view>

<view class="panel" v-else>
    <view class="order-ico">
        <image class="wh100" src="/static/images/sbzf.png"></image>
    </view>
    <view class="pay-way">
        <view class="co-red">¥{{order.order_amount}}</view>
    </view>
    <view class="pay-way pay-hway">订单支付成功</view>
    <view class="pay-way">
       订单编号 : <view class="co-red cr-h">{{order.order_sn}}</view>
    </view>
    <view class="detail-btn" v-if="order.order_type != 6" @tap="lookOrder1">继续提货</view>
    <view class="detail-btn" v-if="order.order_type != 6" @tap="lookOrder">查看订单</view>
    <view class="detail-btn" v-if="order.order_type == 6" @tap="lookOrder">查看拼单</view>
    <view class="tips">注意事项：商城平台及销售商不会以订单异常、系统升级为由
  <view class="line-feed">要求您点击任何网址链接进行退款操作</view></view>
</view>
</view>
</template>

<script>
var app = getApp();
const util = require("../../../utils/util.js");

export default {
  data() {
    return {
      url: app.globalData.setting.url,
      resourceUrl: app.globalData.setting.resourceUrl,
      order: null
    };
  },

  components: {},
  props: {},
  onLoad: function (param) {
    console.log('param', param);
    this.setData({
      order: param
    });

    if (param.take_time) {
      var take_time = util.formatTime(param.take_time);
      this.setData({
        'order.take_time': take_time
      });
    }
  },
  methods: {
    lookOrder: function () {
      if (this.order.order_type == 5) {
        uni.setStorageSync('virtual:virtual_list:update', true);
        uni.redirectTo({
          url: '/pages/virtual/virtual_list/virtual_list'
        });
      } else if (this.order.order_type == 6) {
        uni.setStorageSync('team:order_list:update', true); //wx.redirectTo({ url: '/pages/team/team_order/team_order' });

        console.log(this);

        if (this.order.found_id > 0) {
          uni.redirectTo({
            url: '/pages/team/team_detail/team_detail?foundId=' + this.order.found_id
          });
        } else {
          uni.redirectTo({
            url: '/pages/team/team_detail/team_detail?order_id=' + this.order.order_id
          });
        }
      } else if (this.order.order_type == 8) {
        uni.setStorageSync('order:bargain_order_list:update', true);
        uni.redirectTo({
          url: '/pages/Bargain/order_list/order_list'
        });
      } else if (this.order.order_type == 9) {
        uni.setStorageSync('order:shop_order_list:update', true);
        uni.redirectTo({
          url: '/pages/shop_order/shop_order_list/shop_order_list'
        });
      } else {
        uni.setStorageSync('order:order_list:update', true);
        uni.redirectTo({
          url: '/pages/user/order_list/order_list'
        });
      }
    },
    lookOrder1: function () {
      uni.redirectTo({
        url: '/pages/shopping_card/my_card/my_card'
      });
    },
    beSpeakOrder: function () {
      uni.setStorageSync('order:bespeak_list:update', true);
      uni.redirectTo({
        url: '/pages/bespeak/bespeak_list/bespeak_list'
      });
    }
  }
};
</script>
<style>
/* payment.wxss */
page{
  background-color: #fff;
}
.panel{
    background: #fff;
}
.order-ico{
    padding-top: 66rpx;
    width: 142rpx;
    height: 142rpx;
    margin: 0 auto 54rpx;
}
.pay-way{
    font-size: 30rpx;
    line-height: 1;
    color: #333;
    margin-bottom: 22rpx;
    text-align:center;
}

.pay-hway{
  font-size: 30rpx;
  font-weight: bold;
}
.co-red{
  color: #212121;
  font-size: 48rpx;
  display:inline-block;
}
.cr-h{
  font-size: 30rpx;
}
.detail-btn{
    display: block;
    width: 640rpx;
    margin: 60rpx auto 0;
    line-height: 72rpx;
    border:1px solid #f3f3f3;
    font-size: 32rpx;
    color: #333;
    text-align: center
}
.tips{
    padding: 50rpx 55rpx;
    font-size: 22rpx;
    color: #999;
    line-height:48rpx;
}
.line-feed{
  padding-left: 110rpx;
}
.booksucce_tips  {
    width:100%;
    height: 300rpx;
    text-align: center;
    line-height: 300rpx; 
    font-size: 16pt;
    color: #ff6a00;
}

.booksucce_info  {
    width: 100%;
    height: 60rpx;
    text-align: center;
    font-size: 14pt;
    line-height: 60rpx;
}

 .booksucce_time {
    width: 80%;
    margin: 50rpx auto;
    font-size: 12pt;
    color: #999;
    display: flex;
    flex-direction: row;
    justify-content: space-between
}

.view_bookinfo  {
    width: 80%;
    height: 80rpx;
    font-size: 12pt;
    color: #fff;
    background-color: #ff6a00;
    line-height: 80rpx;
    border-radius: 10rpx;
    text-align: center;
    margin: 0 auto;
}
</style>